package com.infindo.frame.data.mo;

import java.util.ArrayList;
import java.util.List;

import org.json.*;

import com.infindo.frame.util.JSONUtil;

 


public class ServiceMessage extends MoliscMessage{
 
	private static final long serialVersionUID = -7855007585216015362L;
 
    private String uid;
    private String platform;
    private String versionId;
    private List<MoliscMessage> parameters = new ArrayList<MoliscMessage>();
    private String appId;
    private String serMethod;
 
    

    public String getUid() {
		return uid;
	}



	public void setUid(String uid) {
		this.uid = uid;
	}



	public String getPlatform() {
		return platform;
	}



	public void setPlatform(String platform) {
		this.platform = platform;
	}



	public String getVersionId() {
		return versionId;
	}



	public void setVersionId(String versionId) {
		this.versionId = versionId;
	}



	public List<MoliscMessage> getParameters() {
		return parameters;
	}



	public void setParameters(List<MoliscMessage> parameters) {
		this.parameters = parameters;
	}



	public String getSerMethod() {
		return serMethod;
	}



	public void setSerMethod(String serMethod) {
		this.serMethod = serMethod;
	}



	public String getAppId() {
		return appId;
	}



	public void setAppId(String appId) {
		this.appId = appId;
	}



	public ServiceMessage() {
		super();
	}
 
 
 
	@SuppressWarnings("null")
	public void toObject(JSONObject jsonObj,String cmsListParameters){
		try{
		    JSONArray array = jsonObj.getJSONArray(cmsListParameters);
			if(array!=null || array.length()>0){
 
				for(int i=0;i<array.length();i++){
					JSONObject jsonobj = (JSONObject)array.get(i);
					if(jsonobj!=null){
						String clazz2 = jsonobj.getString("clazz");
 
						MoliscMessage mMsg = (MoliscMessage)JSONUtil.convertToBean(jsonobj,clazz2, true);
						mMsg.toObject(jsonobj,cmsListParameters);
					 
					}
					
				}
			}
		}catch(Exception e){
 
		}
		
	}



	/* (non-Javadoc)
	 * @see com.infindo.frame.data.mo.MoliscMessage#toObject(org.json.JSONObject)
	 */
	@Override
	public void toObject(JSONObject jsonObj) {
		// TODO Auto-generated method stub
		
	}
}
